<template>
    <div class="mui-numbox" data-numbox-min='1' style="height: 25px;">
        <button class="mui-btn mui-btn-numbox-minus" type="button">-</button>
        <input id="test" class="mui-input-numbox" type="number" :value="count" 
        @change="countChanged" ref="numbox" readonly/>
        <button class="mui-btn mui-btn-numbox-plus" type="button">+</button>
    </div>
</template>

<script>
    import mui from "../../lib/mui/js/mui.min.js";
    export default {
        data() {
            return {
                
            }
        },
        // 这个和图片分享的滑动导航一样要放在mounted这里，也要导入相关js
        // .mui-numbox 是选择器
        mounted() {
            mui(".mui-numbox").numbox()
            // console.log(this.max) 
        },
        methods: {
            
            countChanged() {
            //    console.log(this.$refs.numbox.value)
               this.$store.commit("updateGoodsInfo", {id: this.goodsid,count:this.$refs.numbox.value})
           }
        },
        props: ["count","goodsid"]
    }

</script>

<style>

</style>